package org.gruposp2p.proyectokarma.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.GeneratedValue;

@Entity
@Table(name="DocumentTag")
public class DocumentTag  implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	@Id @GeneratedValue(strategy=IDENTITY)
     @Column(name="id", unique=true, nullable=false)
     private Long id;
     @ManyToOne(fetch=FetchType.LAZY)
     @JoinColumn(name="documentId", nullable=false)
     private Document document;
     @ManyToOne(fetch=FetchType.LAZY)
     @JoinColumn(name="tagId", nullable=false)
     private Tag tag;

    public DocumentTag() { }

    public DocumentTag(Long id, Document document, Tag tag) {
       this.id = id;
       this.document = document;
       this.tag = tag;
    }

    public Long getId() {
        return this.id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }

    public Document getDocument() {
        return this.document;
    }
    
    public void setDocument(Document document) {
        this.document = document;
    }

    public Tag getTag() {
        return this.tag;
    }
    
    public void setTag(Tag tag) {
        this.tag = tag;
    }

}


